package easy;

public class Solution_1684 {

    public int countConsistentStrings(String allowed, String[] words) {
        boolean[] counts = new boolean[26];
        for (int i = 0; i < allowed.length(); i++) {
            counts[allowed.charAt(i) - 'a'] = true;
        }
        int count = 0;
        for (String word : words) {
            int temp = 1;
            for (int i = 0; i < word.length(); i++) {
                if (!counts[word.charAt(i) - 'a']) {
                    temp = 0;
                    break;
                }
            }
            count += temp;
        }
        return count;
    }

    /*public String interpret(String command) {
        return command.replace("()", "o").replace("(al)", "al");
    }*/

    public static void main(String[] args) {
        Solution_1684 model = new Solution_1684();
    }
}
